package com.hutou.chuangke.adapter;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.TextView;

import com.hutou.chuangke.Bean.CleanCacheBean;
import com.hutou.chuangke.R;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by o on 2017/4/7.
 */
public class CleanCacheAdapter extends BaseAdapter{
    private LayoutInflater mInflater;
    private Context mContext;

    public List<CleanCacheBean> getList() {
        return list;
    }

    public void setList(List<CleanCacheBean> list) {
        this.list = list;
    }

    private List<CleanCacheBean> list = new ArrayList<>();
    public CleanCacheAdapter(Context context){
        mInflater = LayoutInflater.from(context);
        mContext = context;
    }



    @Override
    public int getCount() {
        return list.size();
    }

    @Override
    public Object getItem(int position) {
        return list.get(position);
    }

    @Override
    public long getItemId(int position) {
        return position;
    }

    @Override
    public View getView(int position, View convertView, ViewGroup parent) {
        if(convertView == null){
            convertView = mInflater.inflate(R.layout.cache_list_item,null);
        }
        TextView title_tv = (TextView) convertView.findViewById(R.id.title_tv);
        TextView explain_tv = (TextView) convertView.findViewById(R.id.explain_tv);
        TextView cache_count_tv = (TextView) convertView.findViewById(R.id.cache_count_tv);
        return convertView;
    }
}
